class Err(Exception):
    def __init__(self, desc=None):
        self.errcode = self.__class__.__name__
        self.message = desc
    pass

class ErrOk(Err):
    pass

class ErrInvalidForm(Err):
    pass

class ErrObjectNotFound(Err):
    pass

class ErrSystem(Err):
    pass

class ErrRecordNotFound(Err):
    pass

class ErrLoginRequired(Err):
    pass

class ErrAuthenFailed(Err):
    pass

class ErrUserDoesExist(Err):
    pass

class ErrPermissionDenied(Err):
    pass

class ErrUserNotFound(Err):
    pass

class ErrPermissionExistsAlready(Err):
    pass

class ErrPermissionNotFound(Err):
    pass

def is_error(err, errcls):
    return isinstance(err, errcls)